package com.geekstudy;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(urlPatterns = "/demoRedirect", asyncSupported = false)
public class DemoRedirectServlet extends HttpServlet {

    @Override
    public void service(HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws ServletException, IOException {
        System.out.println("进入 DemoRedirectServlet");

        httpResponse.sendRedirect("welcome.jsp?from=DemoRedirectServlet");


        System.out.println("完成 DemoRedirectServlet");
    }
}
